package vcp.controllers;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;

import javax.swing.JTable;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.table.DefaultTableModel;

import vcp.common.AbstractController;
import vcp.common.IController;
import vcp.models.ResolveComplaintsModel;
import vcp.views.ResolveComplaintsView;

public class ResolveComplaintsController extends AbstractController implements
	ActionListener,AncestorListener, IController {
	ResolveComplaintsModel model;
	ResolveComplaintsView view;

	@Override
	public void addModel(Object model) {
		this.model = (ResolveComplaintsModel) model;
	}

	@Override
	public void addView(Object view) {
		this.view = (ResolveComplaintsView) view;	
	}
    
	/*
	private void loadComplaintsTableModel() {
         Object arr[] = {12,18,2,1};		
		 this.view.getComplaintsForm().getDtm().addRow(arr);
	}
	*/

	@Override
	public void actionPerformed(ActionEvent arg0) {
		 System.out.println(arg0);
	}

	@Override
	public void ancestorAdded(AncestorEvent arg) {
		//System.out.println(arg.getAncestor());
		model.loadComplaintsTableModel();
	}

	@Override
	public void ancestorMoved(AncestorEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void ancestorRemoved(AncestorEvent arg0) {
		// TODO Auto-generated method stub
		
	}

}
